<template>
	<view>
		<!-- 服务-一键匹配 -->
		<!-- <u-navbar back-icon-color="#000000" title="一键匹配" title-color="#3F3F3F" :title-bold="true" :background="background"></u-navbar> -->
		<u-navbar back-text="一键匹配" :back-text-style="textStyle" back-icon-color="#000000" style="font-weight: bold;font-family: PingFang SC;"></u-navbar>
		<view class="subject">
			<image style="width: 750rpx;height: auto;" :src="src"
			 mode="widthFix" ></image>
			<!-- 立即预约 -->
		</view>
		<view style="position: fixed;bottom: 0;">
			<view class="LookingBottom" @click="submit()">
				立即预约
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				background: {
					backgroundColor: '#fca800',
				},
				src:'',
				chargeType: '',
				businessId: '',
				isShow: false,
				titleName:""
			}
		},
		onLoad(option) {
			uni.showLoading({
				title: "加载中..."
			})
			this.titleName=option.titleName;
			this.chargeType = option.chargeType;
			this.businessId = option.businessId;
			this.showImg();
			// if(option.chargeType){
			// 	this.chargeType = option.chargeType
			// 	this.businessId = option.businessId
			// }
			// if(option.redirectId){
			// 	this.businessId = option.redirectId
			// }
				
			// var that = this
			// setTimeout(() => {
			// 	console.log(option)
			// 	uni.hideLoading()
			// 	that.isShow = true
			// }, 500)
		},
		methods: {
			// 判断显示的图片
			showImg(chargeType){
				
				let opts = {
					way: true, //true JSON请求；false 表单请求
					method: 'post',
					url: 'business/getImage',
				};
				let data = {
					businessId:this.businessId
				};
				this.http.httpTokenRequest(opts, data).then(res => {
					//打印请求返回的数据 
					
					if (res.code == "200") {
					this.src=res.data;
					setTimeout(() => {
						uni.hideLoading()
					}, 200)
					} else {
						this.$refs.uToast.show({
							title: res.message,
							type: 'error'
						})
					}
				})
				
			},
			submit() {
				uni.navigateTo({
					url: '../online_order?chargeType=' + this.chargeType + '&businessId=' + this.businessId + '&supId=1'+'&titleName='+this.titleName
				})
			}
		}
	}
</script>

<style>
	.subject {
		text-align: center;
	}

	.LookingBottom {
		margin: 36rpx 54rpx;
		background: #FCA800;
		opacity: 1;
		border-radius: 36rpx;
		width: 666rpx;
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		font-size: 34rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #FFFFFF;
		opacity: 1;
	}
</style>
